package cn.kgc.crowdfundingadminspringboot2.service;

import cn.kgc.crowdfundingadminspringboot2.mapper.MessageMapper;
import cn.kgc.crowdfundingadminspringboot2.pojo.Message;
import cn.kgc.crowdfundingadminspringboot2.pojo.MessageExample;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MessageServiceimpl implements MessageService{
    @Resource
    MessageMapper  messageMapper;


    @Override
    public List<Message> queryAll() {
        List<Message> messages = messageMapper.selectByExample(null);
        return messages;
    }

    @Override
    public void update(Message message) {
        messageMapper.updateByPrimaryKey(message);
    }

    @Override
    public List<Message> getid(List<Integer> messageIdList) {
        MessageExample example=new MessageExample();
        MessageExample.Criteria criteria=example.createCriteria();
        criteria.andIdIn(messageIdList);
        List<Message> messages = messageMapper.selectByExample(example);
        return messages;
    }
}
